/**
 * Copyright (C) 2013 Christos Koufogiannakis
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 *     
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.easychart.demo;

import java.util.ArrayList;
import java.util.Arrays;

import com.easychart.chart.BoxPlot;

import android.app.Activity;
import android.os.Bundle;

/**
 * Example full screen BoxPlot
 */
public class ExampleBoxPlot extends Activity {
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
			                      	
		// for each population, the BoxPlot class will find the median,
		// min and max values
		// and upper and lower quartiles
		// and will show a box with wiskers based on these values
		ArrayList<Double>  population1 = new ArrayList<Double>(Arrays.asList(2d,3d,0d,-3d,-2d)); 	
		ArrayList<Double>  population2 = new ArrayList<Double>(Arrays.asList(3d,7d,0d,3d));
		ArrayList<Double>  population3 = new ArrayList<Double>(Arrays.asList(4d,6d,0d,7d,4d,6d,9d));
		ArrayList<Double>  population4 = new ArrayList<Double>(Arrays.asList(5d,8d,4d,7d,9d));
		ArrayList<Double>  population5 = new ArrayList<Double>(Arrays.asList(5d,8d,6d,7d,10d));
		
		BoxPlot boxPlot = new BoxPlot(this);
		boxPlot.addPopulation(population1, "Jan");		
		boxPlot.addPopulation(population2, "Feb");
		boxPlot.addPopulation(population3, "Mar");
		boxPlot.addPopulation(population4, "Apr");
		boxPlot.addPopulation(population5, "May");
		boxPlot.setXTile("Month");
		boxPlot.setYTile("Temperature (F)");
		boxPlot.setPlotTitle("Temperature Measurements");
	
		setContentView(boxPlot);
	}
}